package com.zhu.pre.controller;

import com.zhu.pre.service.MBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by zhu yingzhi on 2017/10/12.
 * @author yingzhi zhu
 * 手机轮播图接口请求路由类
 */
@RestController
@RequestMapping("/m/banner")
public class MBannerController {


    @Autowired
    private MBannerService bannerService;
    /**
     * 获取所有的Banner
     * @return
     */
    @GetMapping(value = "")
    public Object getAllBanne(){
        return bannerService.findAllBanner();
    }

    /**
     * 获取某个id
     * @param id
     * @return
     */
    @GetMapping(value = "/{id}")
    public Object getAllBanne(@PathVariable Long id){
        return bannerService.findById(id);
    }

}
